System and method for efficient basis conversion

ABSTRACT

This invention describes a method for evaluating a polynomial in an extension field F q   M , wherein the method comprises the steps of partitioning the polynomial into a plurality of parts, each part is comprised of smaller polynomials using a q -th  power operation in a field of characteristic q; and computing for each part components of q -th  powers from components of smaller powers. A further embodiment of the invention provides for a method of converting a field element represented in terms of a first basis to its representation in a second basis, comprising the steps of partitioning a polynomial, being a polynomial in the second basis, into a plurality of parts, wherein each part is comprised of smaller polynomials using a q -th  power operation in a field of characteristic q; evaluating the polynomial at a root thereof by computing for each part components of q -th  powers from components of smaller powers; and evaluating the field element at the root of the polynomial.

[0001] This application is a continuation of PCT/CA00/00256 filed on Mar. 13, 2000, and claims the priority of Canadian Patent Application No. 2,265,389 filed on Mar. 12, 1999.

[0002] This invention relates to the field of cryptographic systems, and conversion of elements between bases used in such systems.

BACKGROUND OF THE INVENTION

[0003] It is well known that there is only one finite field of any given order, but that there are many different representations. When an extension field is built by adjoining a root of an irreducible polynomial to the ground field, the choice of irreducible affects the representation of the extension field. In general if F_(q) _(^(m)) is the finite field, where q is a prime and F_(q) is the ground field over which it is defined, the elements of the finite field can be represented in a number of ways depending on the choice of basis. In order to interoperate, cryptographic systems employing finite fields often need to establish a common representation. In addition to the choice of irreducible polynomial, finite fields can also be represented by either polynomial or normal basis. A polynomial basis represents elements of F_(q) _(^(m)) as linear combinations of the powers of a generator element x: {x⁰, x¹, . . . , x^(m−1)}. A normal basis representation represents elements as linear combination of successive q-th powers of the generator element x: {x^(q) ⁰ , x^(q) ¹ , . . . , x^(q) ^(m−1) }. Each basis has its own advantages, and cryptographic implementations may prefer one or the other, or indeed specific types of irreducible polynomials, such as trinomials or pentanomials.

[0004] To support secure communication between devices using different representations, basis conversion, which changes the representation used by one party into that used by another party is generally required.

[0005] Basis conversion often entails the evaluation of a polynomial expression at a given finite field element. If an element a, when represented as a polynomial, is given as a(x)=Σa_(i)x^(i) mod f(x), where f(x) is an irreducible, in one basis, then the conversion of the element a into a new representation using another irreducible polynomial requires that a be evaluated at r, where r is a root of the new irreducible polynomial in the field represented by f(x), then a(r) is the element a in the new representation. Any of the conjugates of r (the other roots of the new irreducible) will also induce equivalent, but different representations.

[0006] There is a need for an efficient method for evaluating these polynomials, for application to basis conversion.

SUMMARY OF THE INVENTION

[0007] In accordance with this invention there is provided a method for evaluating polynomials in an extension field comprising the steps of: partitioning the polynomials into a plurality of parts, such that each part may be computed from smaller polynomials using a q-th power operation in a field of characteristic q.

[0008] In accordance with a further embodiment of the invention there is provided a method for evaluating a polynomial in an extension field comprising the steps of computing components of the q-th powers from components of smaller powers.

BRIEF DESCRIPTION OF THE DRAWINGS

[0009] These and other features of the preferred embodiments of the invention will become more apparent in the following detailed description in which reference is made to the appended drawings wherein:

[0010]FIG. 1 is a schematic diagram illustrating an embodiment of the present invention;

[0011] FIGS. 2(a) and 2(b) are schematic diagrams illustrating an embodiment of the invention;

[0012] FIGS. 3(a) and (b) are schematic diagrams of further embodiments of the invention; and

[0013]FIG. 4 is a schematic diagram of a three level tree according to an embodiment of the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0014] In a first embodiment of the invention, we exemplify a specific case F₂ _(^(m)) of the general field F_(q) _(^(m)) , then in order to evaluate a field element a(x)=Σa_(i)x^(i) in F₂ _(^(m)) , it is noted that approximately one half of the exponents x^(i) are even powers. These powers can be efficiently calculated from lower degree exponents of odd powers. For example, the powers for i=2,4,6,8,10 can be calculated by squaring the powers for i=1,2,3,4,5, respectively. This approach does not apply to the odd powers, but if we partition a into even and odd powers, e.g. a(x)=a_(even)(x)+a_(odd)(x), and if we factor x from the odd powers, then a will be represented by a sum of even powers and x times a sum of even powers.

[0015] Explicitly,

a(x)=(a ₀ +a ₂ x ² +a ₄ x ⁴+ . . . )+x(a ₁ +a ₃ x ² +a ₅ x ⁴+ . . . )=a _(even)(x)+xa′ _(even)(x)

[0016] where a′_(even) (x) is the even-powered polynomial derived by factoring x from a_(odd)(x).

[0017] In a field of characteristic 2, F₂ _(^(m)) squaring is a linear operation, which allows a_(even) and a′_(even) to be expressed as squares of polynomials of smaller (roughly one half) degree. Explicitly, defining b(x)=a₀+a₂x+a₄x²+a₆x³+ . . . and c(x)=a₁+a₃x+a₅x²+a₇x³+ . . . , then a(x) can be expressed as a(x)=(b(x))²+x(c(x))². Now b and c have approximately half the degree of the original polynomial a to be evaluated.

[0018] Evaluation of b (and c) can (recursively) be made by further dividing the polynomial into odd and even parts. The odd part can be shifted to an even power by factoring out x and expressing the result as a combination of squares of lower degree polynomials. At each application of the partitioning and shifting two squaring operations and one multiplication by x are required.

[0019] At some point, the recursive partitioning can be halted and the component polynomials evaluated via one or more methods.

[0020] Note that although we have described the method for the extension fields over F₂, similar application can be made to other characteristics if the polynomials are divided into more components. For example, for the extension held over F₃, the polynomial a(x) might be divided into a(x)=a_(0 mod 3)+a_(1 mod 3)+a_(2 mod 3), where

a _(0 mod)=(a ₀ +a ₃ x ³ +a ₆ x ⁶ . . . )a _(1 mod 3)=(a ₁ x+a ₄ x ⁴ +a ₇ x ⁷ . . . ), and a _(2 mod 3)=(a ₂ x+a ₅ x ⁵ +a ₈ x ⁸ . . . ).

[0021] In general, for extension fields over F_(q) the polynomial may be divided into q parts. Even over characteristic 2, the polynomial a might be broken up into more than 2 polynomials, at the cost of more multiplications by x or powers of x.

[0022] As an example of a preferred embodiment at a given size, consider conversion of polynomial representations over F₂ _(¹⁶³) . An element of this field is represented by the polynomial

a(x)=a ₀ +a ₁ x+a ₂ x ² + . . . a ₁₆₂ x ¹⁶².

[0023] The first branching divides a(x) into:

a(x)=(a ₀ +a ₂ x+a ₄ x ² +a ₆ x ³ + . . . +a ₁₆₂ x ⁸¹)² +x(a ₁ +a ₃ x+a ₅ x ² +a ₇ x ³ + . . . +a ₁₆₁ x ⁸⁰)²=(b(x))² +x(c(x))²,

[0024] where b(x) and c(x) are each polynomials referred to as component polynomials C_(i), C_(j). At the next level down,

b(x)=(b ₀ +b ₂ x+b ₄ x ² +b ₆ x ³ + . . . +b ₈₀ x ⁴⁰)² +x(b ₁ +b ₃ x+b ₅ x ² +b ₇ x ³ + . . . +b ₈₁ x ⁴⁰)²=(d(x))² +x(e(x))².

[0025] The polynomial c(x) is partitioned in a similar way.

[0026] As mentioned above, the partitioning of polynomials into parts may be halted and the resulting component polynomials evaluated at a root by using any one of several known methods. The positions at which the partitioning stops may be denoted as the leaves of the evaluation tree. The component polynomials at the leaves may be evaluated either directly, or with Horner's rule. However, current methods do not exploit a property of finite fields of characteristic q, wherein taking the q -th powers is usually an efficient operation.

[0027] An exemplary method will now be described for efficiently evaluating a component polynomial for extension fields over F₂.

[0028] At the leaf, a component polynomial a(x)=Σa_(i)x^(i) must be evaluated at a root of a new irreducible. Again, approximately one half of these terms will be even and can be calculated efficiently from odd powers. These odd powers will either be stored, for explicit basis conversion, or calculated explicitly by multiplication. If, for example a(x) is guaranteed to be of degree not greater than 10 (which may be the case if certain evaluation tree depths are employed), then a(x) can be evaluated from the powers 1,3,5,7,9, which are either stored or calculated. Squarings can be reduced by grouping coefficients together. This is shown schematically in FIG. 2(a) where a notional table is constructed to show the relationship between the stored or evaluated odd powers of r and the higher degree even powers of r. Thus, consider the first row in which r², r⁴ and r⁸ are derived by squaring r¹, similarly, r⁶ is derived by squaring r³ and r¹⁰ is derived by squaring r⁵. It is to be noted that in this example, powers of 2 are used.

[0029] Turning back to FIG. 2(a), however, the notional table may be used as shown schematically in FIG. 2(b). Thus, assume an accumulator is set initially to 0. Since we are using an extension field over F₂ the coefficients a_(i) are either 0 or 1. First, if a₈ is 1, then r¹ is added to the accumulator, which consists of a copying operation in a processor. Next, the accumulator is squared. Next, if a₄ is 1, then r¹ is added into the accumulator. Again, the accumulator is squared. Now, if a₂, a₆, a₁₀ are one (1) then r¹, r³, r⁵ are added into the accumulator respectively. Again, the accumulator is squared. Finally, if a₀,a₁,a₃,a₅,a₇,a₉ are set (1), then r⁰,r¹,r³,r⁵,r⁷,r⁹ are added into the accumulator. This completes the evaluation of a(x) at r, requiring three squares and the initial evaluation of r⁰,r¹,r³,r⁵,r⁷,r⁹, which can be reused at another leaf evaluation.

[0030] It will be apparent to those skilled in the art that the precomputed values technique can equally well be applied to multiplication techniques.

[0031] For polynomials of larger degrees, similar evaluations can be made from evaluation of odd powers. First, the coefficients of those exponents with the largest powers of 2 are added into the accumulator according to whether the polynomial to be evaluated has non-zero coefficients at those powers, then the result is squared. Next, powers divisible by one less power of 2 are added in as required by polynomial evaluation. Accumulation and squaring continues until the odd powers themselves are added in as required by the polynomial under evaluation.

[0032] In FIGS. 3(a) and 3(b), a similar evaluation is exemplified for an extension field over F₃ and for a polynomial of degree no greater than 17. Note that in this embodiment, the coefficients a_(i) may take a value 0, 1, or 2. Thus, the powers are added with the required coefficients. In general then, for an extension field over F_(q), powers of q are used to construct the notional table and evaluation of the polynomial proceeds by accumulation and q powering until all required powers in the polynomial are added in as required by the polynomial being evaluated.

[0033] An application of the above method to basis conversion may be illustrated as below. Given a field F₂ _(³¹) and a pair of bases having respective irreducible f₁ and f₂ and if f₁=x³¹+x⁶+1; and f₂=x³¹+x³+1. Then, a root of f₁ in the field represented by f₂ is given by r=x²⁶+x²⁴+x²³+x²²+x¹⁹+x¹⁷+x¹²+x¹¹+x⁹+x⁸+x⁶+x⁵+x³+x². Now, to convert an element a(x)=a_(f) ₁ in the first basis to a representation in the second basis a_(f) ₂ (that is to basis defined by f₂) we proceed as follows. Let ${a(x)} = {\sum\limits_{i = 0}^{30}\quad {a_{i}x^{i}}}$

[0034] in general. For this example, we choose a specific element:

a(x)=x ³⁰ +x ²⁹ +x ²⁸ +x ²⁷ +x ²⁵ +x ²² +x ²⁰ +x ¹⁹ +x ¹⁴ +x ¹³ +x ¹² +x ¹¹ +x ¹⁰ +x ⁸ +x ⁷ +x ⁶ +x ³ +x ⁰

[0035] We assume a three level evaluation tree which is constructed in accordance with the present invention as shown in FIG. 4. At the bottom level of the tree (the leaf nodes), we require the following powers of r: r⁰, r¹, r² . . . r⁷. The odd powers are calculated r¹, r³, r⁵, and r⁷ (by squaring r and 3 multiplications by r²).

[0036] When a above is decomposed in the tree, the leaf nodes are:

L ₀=(r⁷ +r ⁵ +r ³ +r ²+1)²

L ₁ =r(r ⁷ +r ⁵ +r ³ +r ² +r)²

L ₂=(r ⁷ +r ³)²

L ₃ =r(r ⁶ +r ⁵ +r ⁴ +r ² +r+1)²

[0037] To evaluate the leaf node L₀, we will evaluate the component polynomial, then square it and, when appropriate, further multiply its value by r to obtain the value of the leaf node:

[0038] 0) zero A

[0039] 1) add r¹ to A, square A, now A=r²

[0040] 2) add in r⁰, r³, r⁵, r⁷ to A

[0041] 3) square A=L₀

[0042] For L₁, we will

[0043] 0) zero A

[0044] 1) add r¹ to A

[0045] 2) square A

[0046] 3) add r¹, r³, r⁵, r⁷, to A

[0047] 4) square A

[0048] 5) multiply A by r=L1

[0049] for L₂

[0050] 0) zero A

[0051] 1) add in r³, r⁷

[0052] 2) square A=L₂

[0053] for L₃

[0054] 0) zero A

[0055] 1) add in r¹

[0056] 2) square A=r²

[0057] 3) add in r¹, r³

[0058] 4) square A=r⁶+r⁴+r²

[0059] 5) add in r⁰,r¹,r⁵

[0060] A=r⁶+r⁵+r⁴+r²+r+1

[0061] 6) square A

[0062] 7) multiply A by r=L₃

[0063] Now a(r) is built by evaluating the tree M₀=(L₀+L₁)², M₁=r(L₂+L₃)². Finally, a(r)=T₀=M₀+M₁.

[0064] Thus, it may be seen that his method may be applied to various cryptographic schemes such as key exchange schemes, signature schemes and encryption schemes.

[0065] Although the invention has been described with reference to certain specific embodiments, various modifications thereof will be apparent to those skilled in the art without departing from the spirit and scope of the invention as outlined in the claims appended hereto. For example, the invention may be applied to basis conversion wherein the bases to be converted between are an optimal normal basis and a polynomial basis. 

The embodiments of the invention in which an exclusive property or privilege is claimed are defined as follows:
 1. A method for converting an element of a finite field of characteristic q used in a cryptographic system from a representation in a first basis defined by a first irreducible polynomial to a representation in a second basis defined by a second irreducible polynomial, said method comprising the steps of: a) representing said element of said finite field in said first basis as a polynomial a(x); b) determining a root r of said second irreducible polynomial; c) evaluating said polynomial a(x) at said root r to obtain a representation a(r) of a(x) in said second basis; said evaluation being characterised by the steps of: d) partitioning said polynomial a(x) into a plurality of component polynomials, so that said plurality of component polynomials may be combined to obtain said polynomial a(x) by using the operations of multiplication by x and exponentiation by q; e) obtaining values of each of said component polynomials by evaluating each of said component polynomials at said root r; f) computing the value of a(r) from said values of said component polynomials at said root r, using the operations of multiplication by r and exponentiation by q;
 2. A method according to claim 1, wherein the evaluation of said component polynomials comprises evaluating said component polynomials directly.
 3. A method according to claim 1, wherein the evaluation of said component polynomials comprises using Horner's rule to evaluate said component polynomials.
 4. A method according to claim 1, wherein said polynomial a(x) is partitioned into q component polynomials C₀, C₁, . . . , C_(q−1).
 5. A method according to claim 4, wherein said component polynomials are combined using the formula a(r)=(C₀(r))^(q)+r(C₁(r))^(q)+r²(C₁(r))^(q)+ . . . +r^(q−1)(C_(q−1)(r))^(q).
 6. A method according to claim 1, wherein said polynomial a(x) is partitioned into q² component polynomials C₀, C₁, . . . , C_(q) _(²) ⁻¹.
 7. A method according to claim 6, wherein said component polynomials are combined using the formula ${a(r)} = {\sum\limits_{i = 0}^{q - 1}\quad {{r^{i}\left( {\sum\limits_{j = 0}^{q - 1}\quad {r^{i}\left( {C_{j + {qi}}(r)} \right)}^{q}} \right)}^{q}.}}$


8. A method according to claim 1, wherein said finite field is F₂ _(^(m)) and said characteristic q is equal to
 2. 9. A method according to claim 8, wherein said polynomial a(x) is partitioned into 2 component polynomials b(x) and c(x).
 10. A method according to claim 9, wherein said component polynomials are combined using the formula a(r)=(b(r))²+r(c(r))².
 11. A method according to claim 8, wherein said polynomial a(x) is partitioned into 4 component polynomials C₀, C₁, C₂, C₃.
 12. A method according to claim 11, wherein said component polynomials are combined using the formula a(r)=(C₀(r))²+r(C₁(r))²+r((C₂(r))²+r(C₃(r))²)².
 13. A method according to claim 8, wherein said finite field is F₂ _(¹⁶³) .
 14. The method of claim 1, in which the evaluation of the component polynomials is further characterised by the steps of: a) determining a set of exponents of x appearing in the component polynomial, such that all exponents appearing in said component polynomial are q-multiples of the exponents in said set of exponents; b) computing the exponentiation of r to the exponents in the set of exponents to obtain a first set of exponentiations; c) computing the exponentiation of r to q-multiples of the exponents in said set of exponents to obtain a second set of exponentiations, the computation using the first set of exponentiations and the operation of exponentiation by q; d) combining said first and second sets of exponentiations in accordance with said component polynomial to obtain the value of evaluation of said component polynomial.
 15. A method according to claim 14, wherein said finite field is F₂ _(^(m)) whereby said characteristic q is equal to
 2. 16. A method according to claim 15, wherein said finite field is F₂ _(¹⁶³) .
 17. A method according to claim 15, wherein a set of exponentiations by odd exponents is precomputed and used for multiple basis conversions.
 18. A method for evaluating a polynomial a(x) at a point r, said method comprising the steps of: a) partitioning said polynomial a(x) into a plurality of component polynomials, so that said plurality of component polynomials may be combined to obtain said polynomial a(x) by using the operations of multiplication by x and exponentiation by q; b) obtaining values of each of said component polynomials by evaluating each of said component polynomials at said root r; c) computing the value of a(r) from the values of said component polynomials at said root r, using the operations of multiplication by r and exponentiation by q;
 19. A method according to claim 18, wherein the computation of said component polynomials further comprises the steps of: a) determining a set of exponents of x appearing in the component polynomial, such that all exponents appearing in said component polynomial are q-multiples of the exponents in said set of exponents; b) computing the exponentiation of r to the exponents in the set of exponents to obtain a first set of exponentiations; c) computing the exponentiation of r to q-multiples of the exponents in said set of exponents to obtain a second set of exponentiations, the computation using the first set of exponentiations and the operation of exponentiation by q; d) combining said first and second sets of exponentiations in accordance with said component polynomial to obtain the value of evaluation of said component polynomial.
 20. In a cryptographic system utilising elements of a finite field of characteristic q represented as a polynomial a(x) in a first basis defined by a first irreducible polynomial, the method of evaluating said polynomial a(x) at an element r of said field comprising the steps of: a) partitioning said polynomial a(x) into a plurality of component polynomials, so that said plurality of component polynomials may be combined to obtain said polynomial a(x) by using the operations of multiplication by x and exponentiation by q; b) obtaining values of each of said component polynomials by evaluating each of said component polynomials at said root r; c) computing the value of a(r) from the values of said component polynomials at said root r, using the operations of multiplication by r and exponentiation by q;
 21. A method according to claim 20, wherein the computation of said component polynomials further comprises the steps of: a) determining a set of exponents of x appearing in the component polynomial, such that all exponents appearing in said component polynomial are q-multiples of the exponents in said set of exponents; b) computing the exponentiation of r to the exponents in the set of exponents to obtain a first set of exponentiations; c) computing the exponentiation of r to q-multiples of the exponents in the set of exponents to obtain a second set of exponentiations, the computation using the first set of exponentiations and the operation of exponentiation by q; d) combining said first and second sets of exponentiations in accordance with said component polynomial to obtain the value of evaluation of said component polynomial.
 22. A computing device including an accumulator for evaluating a polynomial a(x) of degree d at an element r of a finite field of characteristic 2, said device being programmed to: a) initialize said accumulator to 0; b) for each odd number k<d, compute and store a value r^(k); c) compute a value t=2^(l) such that 2^(l)≦d<2^(l+1); d) while t≧1, repeat the steps: i) for each s from 1 to $\left\lfloor \frac{d}{t} \right\rfloor$

 if a_(st)=1 then add r^(s) to the accumulator; ii) square R; iii) set ${t = \frac{t}{2}};$

 whereby the accumulator holds the value of a(r). 